package com.zhang.mapper;

import com.zhang.entity.ScriptTemplate;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * User: 张
 * Date: 2024-11-19
 * Time: 21:42
 * Description:
 */
@Mapper
public interface ScriptTemplateMapper {
    @Select("select * from visions_sort.script_template where script_id = #{scriptId}")
    ScriptTemplate getScriptTemplateById(Integer scriptId);

    @Insert("insert into visions_sort.script_template (script_name, script_content, script_description) " +
            "VALUE (#{scriptName},#{scriptContent},#{scriptDescription})")
    int addScriptTemplate(ScriptTemplate scriptTemplate);

    List<ScriptTemplate> getScriptTemplate(ScriptTemplate scriptTemplate);

    int updateScriptTemplate(@Param("scriptContent") String scriptContent,@Param("scriptId") Integer scriptId);

    @Delete("delete from visions_sort.script_template where script_id = #{scriptId}")
    int deleteScriptTemplate(Integer scriptId);
}
